<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扩展运算符应用</title>
</head>

<body>
    <div id="root">
        <div></div>
        <div></div>
        <div></div>
    </div>
    <script>
        //1. 数组的合并 
        let arr1 = ['S', 'H', 'E'];
        let arr2 = ['苏有朋', '陈志朋', '吴奇隆'];

        //ES5
        // let res = arr1.concat(arr2);
        //ES6
        // let res = [...arr1, ...arr2];
        // console.log(res);

        //2. 将伪数组转为真正的数组
        //2-1 querySelectorAll 返回的伪数组
        // let divs = document.querySelectorAll('#root div');
        // let divArr = [...divs];

        //2-2 children 伪数组
        let {children} = document.querySelector('#root');
        //将伪数组转为数组
        let result = [...children];
        console.log(result);
        
    </script>
</body>

</html>